package com.chushouya.product.service.api.impl;

import com.general.framework.core.lang.Beans;
import com.chushouya.product.dao.repository.CategoryRepository;
import com.chushouya.product.dto.admin.category.CategoryQuery;
import com.chushouya.product.dto.api.category.CategoryApiDTO;
import com.chushouya.product.service.api.CategoryApiService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class CategoryApiServiceImpl implements CategoryApiService {
    @Resource
    private CategoryRepository categoryRepository;

    @Override
    public List<CategoryApiDTO> categoryList() {
        CategoryQuery query = new CategoryQuery();
//        query.setStatus(StatusEnum.normal.ordinal());
        return Beans.copyList(categoryRepository.selectList(query), CategoryApiDTO.class);
    }
}
